var fs = require('fs');
var txt='这是写入的文件';
fs.readFile('test.txt', 'utf8', function (err, data) {
    if (err) throw err;
    console.log(data);
});
//写入文件
fs.writeFile('test.txt', txt, function (err) {
    if (err) throw err;
    console.log('It\'s saved!'); //文件被保存
});
console.log('hello world');